import Layout from '@/layout'
import ParentView from '@/components/ParentView'
const setRouter = {
  path: '/set',
  component: Layout,
  redirect: '/set/index',
  name: 'Set',
  alwaysShow: true,
  meta: {
    type: 'GI',
    roles: ['6010', '6020', '6030'],
    title: '设置',
    icon: 'setting'
  },
  children: [{
    path: 'data',
    component: ParentView,
    name: 'baseData',
    alwaysShow: true,
    meta: {
      type: 'GI',
      roles: ['6010'],
      title: '基础数据'
    },
    children: [{
      path: 'bizType',
      component: resolve => require(['@/views/set/data/bizType'], resolve),
      name: 'BaseBizType',
      meta: {
        roles: ['601022'],
        title: '业务类型'
      }
    }, {
      path: 'bizProc',
      component: resolve => require(['@/views/set/data/bizProc'], resolve),
      name: 'BaseBizProc',
      meta: {
        roles: ['601026'],
        title: '业务流程'
      }
    }, {
      path: 'salesType',
      component: resolve => require(['@/views/set/data/salesType'], resolve),
      name: 'BaseSalesType',
      meta: {
        roles: ['601030'],
        title: '销售类型'
      }
    }, {
      path: 'settleType',
      component: resolve => require(['@/views/set/data/settleType'], resolve),
      name: 'BaseSettleType',
      meta: {
        roles: ['601034'],
        title: '结算方式'
      }
    }, {
      path: 'referCoa',
      component: resolve => require(['@/views/set/data/referCoa'], resolve),
      name: 'BaseReferCoa',
      meta: {
        roles: ['601036'],
        title: '科目对照'
      }
    }, {
      path: 'paymentType',
      component: resolve => require(['@/views/set/data/paymentType'], resolve),
      name: 'BasePaymentType',
      meta: {
        roles: ['601038'],
        title: '付款方式'
      }
    }, {
      path: 'label',
      component: resolve => require(['@/views/set/data/label'], resolve),
      name: 'BaseLabel',
      meta: {
        roles: ['601042'],
        title: '业务标签'
      }
    }]
  }, {
    path: 'file',
    component: ParentView,
    alwaysShow: true,
    name: 'baseFile',
    meta: {
      type: 'GI',
      roles: ['6020'],
      title: '基本档案'
    },
    children: [{
      path: 'meas',
      component: resolve => require(['@/views/set/file/meas'], resolve),
      name: 'BaseMeas',
      meta: {
        roles: ['602004'],
        title: '计量单位'
      }
    }, {
      path: 'supplier',
      component: resolve => require(['@/views/set/file/supplier'], resolve),
      name: 'BaseSupplier',
      meta: {
        type: 'I',
        roles: ['602010'],
        title: '供应商'
      }
    }, {
      path: 'channel',
      component: resolve => require(['@/views/set/file/channelType'], resolve),
      name: 'BaseChannel',
      meta: {
        type: 'I',
        roles: ['602014'],
        title: '渠道类型'
      }
    }, {
      path: 'custType',
      component: resolve => require(['@/views/set/file/custType'], resolve),
      name: 'BaseCustType',
      meta: {
        type: 'I',
        roles: ['602022'],
        title: '客户类别'
      }
    }, {
      path: 'cust',
      component: resolve => require(['@/views/set/file/cust'], resolve),
      name: 'BaseCust',
      meta: {
        type: 'I',
        roles: ['602026'],
        title: '客户'
      }
    }, {
      path: 'warehouse',
      component: resolve => require(['@/views/set/file/warehouse'], resolve),
      name: 'BaseWarehouse',
      meta: {
        type: 'I',
        roles: ['602030'],
        title: '仓库'
      }
    }, {
      path: 'truck',
      component: resolve => require(['@/views/set/file/truck'], resolve),
      name: 'BaseTruck',
      meta: {
        type: 'I',
        roles: ['602034'],
        title: '车辆'
      }
    }, {
      path: 'invCatg',
      component: resolve => require(['@/views/set/file/invCatg'], resolve),
      name: 'BaseInvCatg',
      meta: {
        type: 'I',
        roles: ['602038'],
        title: '存货分类'
      }
    }, {
      path: 'item',
      component: resolve => require(['@/views/set/file/item'], resolve),
      name: 'BaseItem',
      meta: {
        type: 'I',
        roles: ['602042'],
        title: '存货'
      }
    }, {
      path: 'route',
      component: resolve => require(['@/views/set/file/route'], resolve),
      name: 'BaseRoute',
      meta: {
        type: 'I',
        roles: ['602046'],
        title: '线路'
      }
    }, {
      path: 'brand',
      component: resolve => require(['@/views/set/file/brand'], resolve),
      name: 'BaseBrand',
      meta: {
        type: 'I',
        roles: ['602050'],
        title: '品牌'
      }
    }, {
      path: 'dept',
      component: resolve => require(['@/views/set/file/dept'], resolve),
      name: 'BaseDept',
      meta: {
        type: 'I',
        roles: ['602058'],
        title: '部门'
      }
    }, {
      path: 'staff',
      component: resolve => require(['@/views/set/file/staff'], resolve),
      name: 'BaseStaff',
      meta: {
        type: 'I',
        roles: ['602062'],
        title: '职员'
      }
    }, {
      path: 'proj',
      component: resolve => require(['@/views/set/file/proj'], resolve),
      name: 'BaseProj',
      meta: {
        type: 'I',
        roles: ['602066'],
        title: '项目'
      }
    }, {
      path: 'invCurrency',
      component: resolve => require(['@/views/set/file/currency'], resolve),
      name: 'BaseCurrency',
      meta: {
        type: 'G',
        roles: ['602070'],
        title: '币种'
      }
    }, {
      path: 'catogery',
      component: resolve => require(['@/views/set/file/catogery'], resolve),
      name: 'BaseCatogery',
      meta: {
        type: 'G',
        roles: ['602074'],
        title: '凭证字'
      }
    }, {
      path: 'summary',
      component: resolve => require(['@/views/set/file/summary'], resolve),
      name: 'BaseSummary',
      meta: {
        type: 'G',
        roles: ['602076'],
        title: '常用摘要'
      }
    }, {
      path: 'coaList',
      component: resolve => require(['@/views/set/file/coaList'], resolve),
      name: 'coaList',
      meta: {
        type: 'G',
        roles: ['602078'],
        title: '科目'
      }
    }, {
      path: 'cashflow',
      component: resolve => require(['@/views/set/file/cashflow'], resolve),
      name: 'cashflow',
      meta: {
        type: 'G',
        roles: ['602086'],
        title: '现金流量项目'
      }
    }]
  }, {
    path: 'template',
    component: ParentView,
    alwaysShow: true,
    name: 'template',
    meta: {
      type: 'GI',
      roles: ['6030'],
      title: '模板设置'
    },
    children: [{
      path: 'vouchertype',
      component: resolve => require(['@/views/set/template/vouchertype'], resolve),
      name: 'Vouchertype',
      meta: {
        type: 'G',
        roles: ['603010'],
        title: '凭证模板类型'
      }
    }, {
      path: 'voucher',
      component: resolve => require(['@/views/set/template/voucher'], resolve),
      name: 'VoucherTemplate',
      meta: {
        type: 'G',
        roles: ['603020'],
        title: '凭证模板'
      }
    }, {
      path: 'bill',
      component: resolve => require(['@/views/set/template/bill'], resolve),
      name: 'BillTemplate',
      meta: {
        type: 'I',
        roles: ['603030'],
        title: '单据模板'
      }
    }, {
      path: 'billAdd',
      component: resolve => require(['@/views/set/template/billAdd'], resolve),
      hidden: true,
      name: 'BillAdd',
      meta: {
        type: 'I',
        roles: ['603030'],
        title: '新增单据模板'
      }
    }, {
      path: 'billModify',
      component: resolve => require(['@/views/set/template/billAdd'], resolve),
      hidden: true,
      name: 'BillModify',
      meta: {
        type: 'I',
        roles: ['603030'],
        title: '编辑单据模板'
      }
    }, {
      path: 'rpt',
      component: resolve => require(['@/views/set/template/rpt'], resolve),
      name: 'RptTemplate',
      meta: {
        type: 'I',
        roles: ['603040'],
        title: '报表模板'
      }
    }, {
      path: 'rptModify',
      component: resolve => require(['@/views/set/template/rptAdd'], resolve),
      name: 'RptModify',
      hidden: true,
      meta: {
        type: 'I',
        roles: ['603040'],
        title: '编辑报表模板'
      }
    }, {
      path: 'rptAdd',
      component: resolve => require(['@/views/set/template/rptAdd'], resolve),
      name: 'RptAdd',
      hidden: true,
      meta: {
        type: 'I',
        roles: ['603040'],
        title: '新增报表模板'
      }
    }]
  }]
}

export default setRouter
